package org.jeecg.modules.enhance.java;

import java.text.ParseException;
import java.util.Map;

import org.jeecg.common.util.SpringContextUtils;
import org.jeecg.modules.online.cgform.enhance.CgformEnhanceJavaInter;
import org.jeecg.modules.online.config.exception.BusinessException;
import org.jeecg.modules.system.controller.SysAnnouncementController;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;

@Component("CheckinApprove")
public class CheckinApprove implements CgformEnhanceJavaInter {

    
	@Override
	public int execute(String tableName, JSONObject json) throws BusinessException {

	String status = json.getString("status");
     try {
     SysAnnouncementController s=(SysAnnouncementController)SpringContextUtils.getBean(SysAnnouncementController.class);
     String title="采购移交入库申请";
     String msgContent=json.toJSONString();

    	// addAndSend(String title,String msgContent,int megType,String receiveUserIds )
		//s.addAndSend(title,msgContent,0,"");
     s.addAndSend(title,msgContent,1,"1433851120400248834,");
	} catch (ParseException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}

	return 0;

	}

	@Override
	public int execute(String tableName, Map<String, Object> map) throws BusinessException {
		System.out.println("2");
		return 1;
	}

}